/ Assembly List / LJCNetCommon / LJCAssemblyReflect / SetMethodInfo

Namespace - LJCNetCommon


Parameters
methodName - The Method name.
parameterNames - The parameter types.

Returns

The MethodInfo value.

Syntax

C#
public MethodInfo SetMethodInfo(String methodName, String[] parameterNames)

Set the MethodInfo reference. (RE)

Remarks

Sets the MethodName property value and attempts to set the MethodInfo property value if the type reference and method with the correct parameters exist.

Example

C#
using System;
using System.Reflection;
using LJC.Net.Common;

public MethodInfo RetrieveMethodInfo(string assemblyFileSpec, string fullTypeName
  , string methodName, string[] parameterNames)
{
  MethodInfo retValue = null;

  // These calls are not required if an LJCAssemblyReflect reference is
  // used and the the following set methods have already been executed.
  LJCAssemblyReflect assemblyReflect = new LJCAssemblyReflect();
  Assembly assembly = assemblyReflect.SetAssembly(assemblyFileSpec);
  Type typeReference = assemblyReflect.SetTypeReference(fullTypeName);
    
  retValue = assemblyReflect.SetMethodInfo(methodName, parameterNames);
  return retValue;
}

Copyright © Lester J. Clark and Contributors.
Licensed under the MIT License.